<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class AggregateReport extends Model
{
    use HasFactory, SoftDeletes;

    protected $casts = [
        'data' => 'json',
    ];

    public $fillable = ['sheet_template_id', 'frequency', 'year', 'key'];

    public function sheetTemplate()
    {
        return $this->belongsTo(SheetTemplate::class)->select('id', 'name', 'type');
    }
}
